package com.jokey.vue.utils;

import com.jokey.vue.model.Hr;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @author: JokeyZheng
 * @email: zhengjingfeng@ruqimobility.com
 * @created: 2021/11/26 18:55
 * @version: v1.0.0
 */
public class HrUtils {

    public static Hr getCurrentHr() {
        return ((Hr) SecurityContextHolder.getContext().getAuthentication().getPrincipal());
    }

    public static Authentication getCurrentHrAuthentication() {
        return SecurityContextHolder.getContext().getAuthentication();
    }
}
